<?php /*a:1:{s:64:"/www/wwwroot/marry.idhx.top/view/admin/system/system_config.html";i:1712213943;}*/ ?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layuimini/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuimini/css/public.css" media="all">
    <style>
        .ccc {
            color: #ccc;
        }
    </style>
</head>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">


            <div class="layui-tab layui-tab-brief">
                <ul class="layui-tab-title">
                    <li class="layui-this">网站设置</li>
                    <li>小程序设置</li>
                    <li>数据设置</li>
                    <!-- <li>上传设置</li> -->
                    <li>开发文档</li>
                </ul>
                <div class="layui-tab-content">
                    <!-- 网站设置 -->
                    <div class="layui-tab-item layui-show">
                        <form class="layui-form" action="">
                            <div class="layui-form-item">
                                <label class="layui-form-label">后台名称</label>
                                <div class="layui-input-block">
                                    <input type="text" name="admin_title" lay-verify="title" autocomplete="off"
                                        class="layui-input" value="<?php echo isset($one['admin_title']) ? htmlentities($one['admin_title']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.admin_title</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">后台简称</label>
                                <div class="layui-input-block">
                                    <input type="text" name="admin_small_title" lay-verify="title" autocomplete="off"
                                        class="layui-input" value="<?php echo isset($one['admin_small_title']) ? htmlentities($one['admin_small_title']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.admin_small_title</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">后台域名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="admin_domain" lay-verify="title" autocomplete="off"
                                        class="layui-input" value="<?php echo isset($one['admin_domain']) ? htmlentities($one['admin_domain']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.admin_domain</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">接口域名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="api_domain" lay-verify="title" autocomplete="off"
                                        class="layui-input" value="<?php echo isset($one['api_domain']) ? htmlentities($one['api_domain']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.api_domain</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">后台LOGO</label>
                                <div class="layui-input-block">
                                    <div class="layui-upload">
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img" style="width: 92px;height:92px;" id="demo2" src="/system/<?php echo isset($one['admin_logo']) ? htmlentities($one['admin_logo']) : ''; ?>">
                                            <input type="hidden" id="admin_logo" name="admin_logo" lay-verify="title" autocomplete="off"
                                            class="layui-input" value="<?php echo isset($one['admin_logo']) ? htmlentities($one['admin_logo']) : ''; ?>">
                                            <p id="demoText"></p>
                                        </div>
                                    </div>
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.admin_logo</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                           
                            <div class="layui-form-item">
                                <label class="layui-form-label">版权信息</label>
                                <div class="layui-input-block">
                                    <input type="text" name="admin_copyright" lay-verify="title" autocomplete="off"
                                        class="layui-input" value="<?php echo isset($one['admin_copyright']) ? htmlentities($one['admin_copyright']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.admin_copyright</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">备案号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="admin_filing" lay-verify="title" autocomplete="off"
                                        class="layui-input" value="<?php echo isset($one['admin_filing']) ? htmlentities($one['admin_filing']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.admin_filing</p>
                                    <?php endif; ?>
                                </div>
                            </div>


                            <!-- <div class="layui-form-item">
                        <label class="layui-form-label">开关-默认关</label>
                        <div class="layui-input-block">
                            <input type="checkbox" name="close" lay-skin="switch" lay-text="ON|OFF">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开关-默认开</label>
                        <div class="layui-input-block">
                            <input type="checkbox" checked="" name="open" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                        </div>
                    </div> -->
                            <!-- <div class="layui-form-item">
                        <label class="layui-form-label">单选框</label>
                        <div class="layui-input-block">
                            <input type="radio" name="sex" value="男" title="男" checked="">
                            <input type="radio" name="sex" value="女" title="女">
                        </div>
                    </div> -->
                            <!-- <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">普通文本域</label>
                        <div class="layui-input-block">
                            <textarea placeholder="请输入内容" class="layui-textarea"></textarea>
                        </div>
                    </div> -->

                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="demo2">立即提交</button>
                                    <!-- <button type="reset" class="layui-btn layui-btn-primary">重置</button> -->
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="layui-tab-item">
                        <form class="layui-form" action="">
                            <div class="layui-form-item">
                                <label class="layui-form-label">appid</label>
                                <div class="layui-input-block">
                                    <input type="text" name="wx_appid" lay-verify="title" autocomplete="off"
                                        class="layui-input" value="<?php echo isset($one['wx_appid']) ? htmlentities($one['wx_appid']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.wx_appid</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">appsecret</label>
                                <div class="layui-input-block">
                                    <input type="text" name="wx_appsecret" lay-verify="title" autocomplete="off"
                                        class="layui-input" value="<?php echo isset($one['wx_appsecret']) ? htmlentities($one['wx_appsecret']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.wx_appsecret</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                           



                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="demo2">立即提交</button>
                                    <!-- <button type="reset" class="layui-btn layui-btn-primary">重置</button> -->
                                </div>
                            </div>
                        </form>
                    </div>
                    <!-- 数据设置 -->
                    <div class="layui-tab-item">
                        <form class="layui-form" action="">
                            <div class="layui-form-item">
                                <label class="layui-form-label">开发者模式</label>
                                <div class="layui-input-block">
                                    <input type="radio" name="is_dev" value="1" title="打开" <?php if($one['is_dev']=='1'): ?>checked="" <?php endif; ?>>
                                    <input type="radio" name="is_dev" value="0" title="关闭" <?php if($one['is_dev']=='0'): ?>checked="" <?php endif; ?>>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">排序设置</label>
                                <div class="layui-input-block">
                                    <input type="radio" name="sort" value="asc" title="正序" <?php if($one['sort']=='asc'): ?>checked="" <?php endif; ?>>
                                    <input type="radio" name="sort" value="desc" title="倒序" <?php if($one['sort']=='desc'): ?>checked="" <?php endif; ?>>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">登录验证码</label>
                                <div class="layui-input-block">
                                    <input type="radio" name="captcha" value="1" title="打开" <?php if($one['captcha']=='1'): ?>checked="" <?php endif; ?>>
                                    <input type="radio" name="captcha" value="0" title="关闭" <?php if($one['captcha']=='0'): ?>checked="" <?php endif; ?>>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="demo2">立即提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <!-- 上传设置 -->
                    <!-- <div class="layui-tab-item">
                        <form class="layui-form" action="">
                            <div class="layui-form-item">
                                <label class="layui-form-label">上传方式</label>
                                <div class="layui-input-block">
                                    <input type="radio" name="upload_type" lay-filter="upload_type" value="1" title="本地"
                                        <?php if(isset($one['upload_type'])&&$one['upload_type']=='1'): ?>checked="" <?php endif; ?>>
                                    <input type="radio" name="upload_type" lay-filter="upload_type" value="2" title="七牛"
                                        <?php if(isset($one['upload_type'])&&$one['upload_type']=='2'): ?>checked="" <?php endif; ?>>
                                </div>
                            </div>
                            <div class="layui-form-item upload_type_item upload_type_qiniu" <?php if(isset($one['upload_type'])&&$one['upload_type']!='2'): ?> style="display: none;" <?php endif; ?>>
                                <label class="layui-form-label">空间名称</label>
                                <div class="layui-input-block">
                                    <input type="text" name="qiniu_bucket" autocomplete="off" class="layui-input"
                                        value="<?php echo isset($one['qiniu_bucket']) ? htmlentities($one['qiniu_bucket']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.qiniu_bucket</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="layui-form-item upload_type_item upload_type_qiniu" <?php if(isset($one['upload_type'])&&$one['upload_type']!='2'): ?> style="display: none;" <?php endif; ?>>
                                <label class="layui-form-label">AK</label>
                                <div class="layui-input-block">
                                    <input type="text" name="qiniu_ak" autocomplete="off" class="layui-input"
                                        value="<?php echo isset($one['qiniu_ak']) ? htmlentities($one['qiniu_ak']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.qiniu_ak</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="layui-form-item upload_type_item upload_type_qiniu" <?php if(isset($one['upload_type'])&&$one['upload_type']!='2'): ?> style="display: none;" <?php endif; ?>>
                                <label class="layui-form-label">SK</label>
                                <div class="layui-input-block">
                                    <input type="text" name="qiniu_sk" autocomplete="off" class="layui-input"
                                        value="<?php echo isset($one['qiniu_sk']) ? htmlentities($one['qiniu_sk']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.qiniu_sk</p>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="layui-form-item upload_type_item upload_type_qiniu" <?php if(isset($one['upload_type'])&&$one['upload_type']!='2'): ?> style="display: none;" <?php endif; ?>>
                                <label class="layui-form-label">空间域名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="qiniu_domain" autocomplete="off" class="layui-input"
                                        value="<?php echo isset($one['qiniu_domain']) ? htmlentities($one['qiniu_domain']) : ''; ?>">
                                    <?php if($one['is_dev']=='1'): ?>
                                    <p class="ccc">sysconfig.qiniu_domain</p>
                                    <?php endif; ?>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="demo2">立即提交</button>
                                </div>
                            </div>
                        </form>
                    </div> -->
                    <!-- 文档 -->
                    <div class="layui-tab-item">
                        <pre class="layui-code" lay-options="{title: 'Custom Title', skin: 'dark'}">
安装验证码
composer require topthink/think-captcha

                        </pre>




                    </div>
                </div>
            </div>




        </div>
    </div>

    <script src="/layuimini/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
    <script>
        layui.use(['form', 'layedit', 'laydate', 'upload'], function () {
            var form = layui.form
                , layer = layui.layer
                , upload = layui.upload
                , $ = layui.$
                , layedit = layui.layedit;
            // , laydate = layui.laydate;
            //常规使用 - 普通图片上传
            var uploadInst = upload.render({
                elem: '#demo1'
                , url: 'uploadLogo' //此处用的是第三方的 http 请求演示，实际使用时改成您自己的上传接口即可。
                , before: function (obj) {
                    //预读本地文件示例，不支持ie8
                    obj.preview(function (index, file, result) {
                        $('#demo1').attr('src', result); //图片链接（base64）
                    });
                    layer.msg('上传中', { icon: 16, time: 0 });
                }
                , done: function (res) {
                    //如果上传失败
                    if (res.status == 1) {
                        $('#admin_logo').val(res.fileName)
                        return layer.msg('上传成功');
                    }
                    //上传成功的一些操作
                    //……
                    $('#demoText').html(''); //置空上传失败的状态
                }
                , error: function () {
                    //演示失败状态，并实现重传
                    // var demoText = $('#demoText');
                    // demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                    // demoText.find('.demo-reload').on('click', function () {
                    //     uploadInst.upload();
                    // });
                }
                //进度条
                , progress: function (n, elem, e) {
                    if (n == 100) {
                        layer.msg('上传完毕', { icon: 1 });
                    }
                }
            });

        


            //此处即为 radio 的监听事件
            form.on('radio(upload_type)', function (data) {

                var value = data.value;
                $('.upload_type_item').hide()
                if (value == 1) {
                    // 普通上传
                } else if (value == 2) {
                    // 七牛
                    $('.upload_type_qiniu').show()
                }
                console.log(value)
            });
            //日期
            // laydate.render({
            //     elem: '#date'
            // });
            // laydate.render({
            //     elem: '#date1'
            // });

            //创建一个编辑器
            // var editIndex = layedit.build('LAY_demo_editor');

            //自定义验证规则
            // form.verify({
            //     title: function (value) {
            //         if (value.length < 5) {
            //             return '标题至少得5个字符啊';
            //         }
            //     }
            //     , pass: [
            //         /^[\S]{6,12}$/
            //         , '密码必须6到12位，且不能出现空格'
            //     ]
            //     , content: function (value) {
            //         layedit.sync(editIndex);
            //     }
            // });

            //监听指定开关
            // form.on('switch(switchTest)', function (data) {
            //     layer.msg('开关checked：' + (this.checked ? 'true' : 'false'), {
            //         offset: '6px'
            //     });
            //     layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
            // });

            //监听提交
            // form.on('submit(demo1)', function (data) {
            //     console.log(data.field)
            //     $.ajax({
            //             type: "post",
            //             url: "systemConfig",
            //             data: data.field,
            //             dataType: "json",
            //             success: function (res) {
            //                 if (res.code == 1) {

            //                 } else {
            //                     layer.msg(res.msg)
            //                 }
            //             }
            //         });
            //         return false;
            // });
            form.on('submit(demo2)', function (data) {
                console.log(data.field)
                $.ajax({
                    type: "post",
                    url: "systemConfig",
                    data: data.field,
                    dataType: "json",
                    success: function (res) {
                        layer.msg(res.msg, { shift: -1, time: 500 }, function () {
                            location.reload()
                        });
                        // location.reload()
                    }
                });
                return false;
            });

            //表单初始赋值
            // form.val('example', {
            //     "username": "贤心" // "name": "value"
            //     , "password": "123456"
            //     , "interest": 1
            //     , "like[write]": true //复选框选中状态
            //     , "close": true //开关状态
            //     , "sex": "女"
            //     , "desc": "我爱 layui"
            // })


        });
    </script>

</body>

</html>